//----------------------------------------------------------------------------------
// CSpriteEpicTestProcess class
// Author: Jose De Gouveia
//
// Description:
// Test para probar el funcionamiento del la clase CSprite
//----------------------------------------------------------------------------------
#pragma once
#ifndef INC_SPRITEEPIC_TEST_PROCESS_H_
#define INC_SPRITEEPIC_TEST_PROCESS_H_

#include "../Sprite.h"
#include <string>

//---Engine Includes----
#include "Core/Core.h"
#include "Core/Process.h"
//-----------------------

//--Forward Declaration--
class CRenderManager;
class CObject3D;
class CInputManager;
//-----------------------

class CSpriteEpicTestProcess: public CProcess
{
public:
	//---Init and End protocols
	CSpriteEpicTestProcess(const std::string& processName):	CProcess(processName),
		m_pObject3D(NULL),m_uBorderWidth(10),m_uSpriteAmount(0),m_fSpeed(1){}

	virtual ~CSpriteEpicTestProcess(void) {Done();}

	//----CProcess Interface---------------------------------------
	virtual bool	      Init	            ();
	virtual bool		  Start		  		()  {m_bStart = true; return true;}

	//---Update and Render function
	virtual void		  Update	        (float elapsedTime);
	virtual void		  RenderScene		(CRenderManager* renderManager, CFontManager* fm);
	virtual uint32		  RenderDebugInfo	(CRenderManager* renderManager, CFontManager* fm, float fps);
	//--------------------------------------------------------------


	void SetDirection(CSpriteEpic *sprite,float angle);
	void Advance(CSpriteEpic *sprite,float speed = 1);
	void CreateSprites(uint32 amount);

private:
	//----CProcess Interface---------------------------------------
	virtual void				Release             ();
	//--------------------------------------------------------------

	void						UpdateInputActions	(CInputManager* inputManager);

private:
	CObject3D*				            m_pObject3D;
  std::vector<CSpriteEpic*>           m_vEpicSprite;
  std::vector<CSpriteEpic*>::iterator m_itEpicSprite;

  std::vector<CSpriteEpic*>           m_vBorderSprite;
	std::vector<CSpriteEpic*>::iterator m_itBorderSprite;
	uint32														m_uBorderWidth;

	CTexture*													m_SpriteTexture;
	std::vector<CTexture *>										m_vSpritesTextures;
	uint32														m_uSpriteAmount;

	uint32														m_uWidth;
	uint32														m_uHeight;
	float														m_fSpeed;
};
#endif


